#pragma once

#include "Movable.h"
#include "Instance.h"
#include "Renderable.h"

namespace RenderSystem
{
	class Mesh;
	class SubMesh;
	class MaterialInstance;
	class MeshInstance;

	class SubMeshInstance
		: public Renderable
	{
	public:
		SubMeshInstance( MeshInstance* pMeshInstance );
		virtual ~SubMeshInstance(void);

		virtual RenderData* GetRenderData( void );
		
		MeshInstance*		GetOwner( void ) const;
		MaterialInstance*	GetMaterialInstance( void ) const;

	private:

		MaterialInstance*	m_pMaterialInstance;
		SubMesh*			m_pSubMesh;
		MeshInstance*		m_pMeshInstance;
	};


	class MeshInstance
		: public Movable, public Instance
	{
	public:

		typedef std::vector< SubMeshInstance* >			SubMeshInstances;
		typedef SubMeshInstances::iterator				SubMeshInstancesIterator;
		typedef SubMeshInstances::const_iterator		SubMeshInstancesConstIterator;

		MeshInstance( const String& strMeshId, Mesh* pResMesh );
		virtual ~MeshInstance(void);

		virtual String GetId(void) const;

	private:

		SubMeshInstances			m_SubMeshInstance;

	};
}